﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:local="clr-namespace:Contoso.WebAnalytics.Design.Editors"
    xmlns:pe="clr-namespace:Microsoft.Windows.Design.PropertyEditing;assembly=Microsoft.Windows.Design.Interaction"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    x:Class="Contoso.WebAnalytics.Design.Editors.ContosoAnalyticsCategoryLayout"
    mc:Ignorable="d">
	<UserControl.Resources>
		<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
		<local:AutoUpdate x:Key="AutoUpdate" d:IsDataSource="True" />
	</UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <StackPanel HorizontalAlignment="Left"  Orientation="Vertical">
    		<Button HorizontalAlignment="Left" FontFamily="Trebuchet MS" FontStyle="Italic" Foreground="#FF6406FC" 
				HorizontalContentAlignment="Right" VerticalContentAlignment="Top" Margin="2">
    			<StackPanel Orientation="Horizontal">
    				<TextBlock Text="þ" Margin="2" TextWrapping="Wrap" FontFamily="Webdings" FontStyle="Normal" 
					Foreground="#FF6521D4" VerticalAlignment="Center" FontSize="13.333"/>
    				<TextBlock Text="Contoso" TextWrapping="Wrap" FontWeight="Bold" Margin="2"/>
    			</StackPanel>
    		</Button>
    		<Button Content="Update Available" Margin="2" Visibility="{Binding IsUpdateAvalable, Converter={StaticResource BooleanToVisibilityConverter}, Source={StaticResource AutoUpdate}}" HorizontalAlignment="Left" FontFamily="Trebuchet MS"/>
    	</StackPanel>
        <ItemsControl ItemsSource="{Binding Properties}" Grid.Row="1">
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <pe:PropertyContainer PropertyEntry="{Binding}" />
                </DataTemplate>
            </ItemsControl.ItemTemplate>
            <ItemsControl.Template>
                <ControlTemplate>
                    <StackPanel IsItemsHost="True"/>
                </ControlTemplate>
            </ItemsControl.Template>
        </ItemsControl>
    </Grid>
</UserControl>
